import { createApp } from 'vue';

import { Popup, Button, Image, Icon, Field, Picker, ImagePreview, Toast as VanToast, Lazyload, Switch, Dialog } from 'vant';
// import 'vant/lib/index.css';
import 'vant/es/toast/style';
import 'vant/es/image-preview/style';
import 'vant/es/notify/style';
import 'vant/es/dialog/style';

import dayjs from 'dayjs';
import 'dayjs/locale/en';
import 'dayjs/locale/zh-cn';

import App from './App.vue';
import router from './router';

import httpArea from './api/http/httpArea';
dayjs.locale();

httpArea.useRouter(router);

const app = createApp(App);

window.app = app;
app.config.globalProperties.productionTip = false;
app.config.globalProperties.$dayjs = dayjs;

// app.use(VueError);
app.use(Popup).use(Button).use(Image).use(Icon).use(Field).use(Picker).use(Lazyload).use(ImagePreview).use(VanToast).use(Switch).use(Dialog);

app.use(router).mount('#app');
